import {logout} from '../../api/login'
const user = {
    state:{
        user:'',
        status:'',
        code:'',
        token:''
    },
    mutations: {
        SET_TOKEN(state,token){
            state.token = token
        }
    },
    actions:{
        LogOut({ commit, state }) {
            return new Promise((resolve, reject) => {
              logout(state.token).then(() => {
                commit('SET_TOKEN', '')                
                // removeToken()
                resolve()
              }).catch(error => {
                reject(error)
              })
            })
        }
    }
};


export default user